package com.pda.yuanjing.dialog.error;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.pda.yuanjing.PDApp;
import com.pda.yuanjing.R;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ErrorDialog extends Dialog {


    @BindView(R.id.ivdiss)
    ImageView ivdiss;
    @BindView(R.id.tverror)
    TextView tverror;
    private Context mContext;

    @OnClick({R.id.ivdiss, R.id.tverror})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ivdiss:
                dismiss();
                break;
            case R.id.tverror:
                break;
        }
    }


    public interface PriorityListener {
        void setActivityText();
    }

    public ErrorDialog(final Context context, String string, int theme, PriorityListener listen) {
        super(context, theme);
        setContentView(R.layout.dialog_error);
        ButterKnife.bind(this);
        mContext = context;
        tverror.setText(string);
    }

    @Override
    public void show() {
        PDApp.scanf = false;
        super.show();
    }

    @Override
    public void dismiss() {
        PDApp.scanf = true;
        super.dismiss();
    }
}


